package wml.switcher;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.Application;

public class MyApplication extends Application {
	private List<Activity> activities = new ArrayList<Activity>();
	private static MyApplication instance = new MyApplication();

	private MyApplication() {

	}

	public static MyApplication getInstance() {
		return instance;
	}

	public void addActivity(Activity activity) {
		this.activities.add(activity);
	}

	public void exit() {
		for (Activity activity : this.activities) {
			activity.finish();
		}
		System.exit(0);
	}
}
